FROM python:3.11-slim-bookworm

USER root

RUN apt-get update && apt-get install -y openssh-server &&  rm -rf /var/lib/apt/lists/*

RUN echo "root:root" | chpasswd && echo "PermitRootLogin yes" >> /etc/ssh/sshd_config

COPY requirements.txt /root/

RUN pip3 install -r /root/requirements.txt --no-cache-dir -i http://mirrors.aliyun.com/pypi/simple --trusted-host mirrors.aliyun.com && rm -rf /root/requirements.txt

RUN pip3 cache purge

CMD ["/etc/init.d/ssh","start"]